package ru.jexp.rcp.supply.beans.d18;

import org.eclipse.swt.custom.CTabFolder;

import ru.jexp.izdelie.izdelie.D18Paket;
import ru.jexp.rcp.supply.swtext.ICTabItemCreator;

public class D18PaketFormCreator implements ICTabItemCreator<D18PaketForm, D18Paket>
{

	@Override
	public D18PaketForm createItem(CTabFolder folder, int index, D18Paket element)
	{
		D18PaketForm tabItem = new D18PaketForm(new D18PaketFormView(folder, index),
			new D18StrForm(new D18StrFormView(folder.getShell())));
		if (index == 0)
		{
			folder.setSelection(index);
		}
		tabItem.edit(element);
		return tabItem;
	}

	@Override
	public Class<D18Paket> getElementType()
	{
		return D18Paket.class;
	}

}
